package com.carkeeper.service;

import com.carkeeper.dto.OrderDTO;
import com.carkeeper.service.serviceFallback.OrderFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(value = "carkeeper-order", fallback = OrderFallbackFactory.class)
public interface OrderFeign {
    /*
     * 获取订单信息
     * */
    @GetMapping("/order/{id}")
    OrderDTO getOrder(@PathVariable("id") Long id);

    /**
     * 获取订单列表
     *
     * @param storeId     商家id
     * @param orderStatus 订单状态
     * @param payStatus   支付状态
     * @return 订单列表
     */
    @GetMapping("/order/list")
    List<OrderDTO> findAll(@RequestParam(name = "storeId", required = false) Long storeId,
                           @RequestParam(name = "orderStatus", required = false) String orderStatus,
                           @RequestParam(name = "payStatus", required = false) String payStatus);
}
